package com.tiny.mirror.service.product.interfaces.controller;

import com.api.tiny.mirror.service.product.AbilityLhcApiService;
import com.api.tiny.mirror.service.product.request.CheckAbilityLhcPlayRequest;
import com.api.tiny.mirror.service.product.response.AbilityLhcVO;
import com.api.tiny.mirror.service.product.response.CheckAbilityLhcPlayVO;
import com.tiny.mirror.basic.log.annotation.LogBody;
import com.tiny.mirror.basic.web.dto.response.BaseResponse;
import com.tiny.mirror.service.product.application.query.AbilityLhcQryService;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: liujsh
 * @Description:
 * @Date: Create in 2023/10/19
 */
@RestController
public class AbilityLhcController implements AbilityLhcApiService {

  @Resource
  private AbilityLhcQryService abilityLhcQryService;

  @Override
  public BaseResponse<AbilityLhcVO> getPlay(@RequestParam(value = "type") Integer type) {
    return BaseResponse.success(abilityLhcQryService.getPlay(type));
  }

  @LogBody
  @Override
  public BaseResponse<CheckAbilityLhcPlayVO> checkPlay(
      @RequestBody @Validated CheckAbilityLhcPlayRequest request
  ) {
    return BaseResponse.success(abilityLhcQryService.checkPlay(request));
  }
}
